package spike.analyzer;

import java.util.HashMap;

public class Analyzer {
 
	
	String tweet = "{\"completed_in\":0.095,\"max_id\":132671075908714496," +
			"\"max_id_str\":\"132671075908714496\",\"next_page\":\"?page=2&max_id=132671075908714496&q=obama\"," +
			"\"page\":1,\"query\":\"obama\",\"refresh_url\":\"?since_id=132671075908714496&q=obama\",\"results\":" +
			"[{\"created_at\":\"Sat, 05 Nov 2011 04:10:24 +0000\",\"from_user\":\"3secondcommute\"," +
			"\"from_user_id\":117500233,\"from_user_id_str\":\"117500233\",\"geo\":null,\"id" +
			"\":132671075908714496,\"id_str\":\"132671075908714496\",\"iso_language_code\":\"en\",\"metadata" +
			"\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a1.twimg.com/profile_images/902281461/garfield_pajamas_normal.jpg" +
			"\",\"source\":\"&lt;a href=&quot;http://twitterfeed.com&quot; rel=&quot;nofollow&quot;&gt;twitterfeed&lt;/a&gt;\"," +
			"\"text\":\"With a Book, the Last Democrat in the White House Tries to Help the Current One: By JODI KANTOR Last summer, as ... http://t.co/FPYTNuVr\"," +
			"\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:23 +0000\"," +
			"\"from_user\":\"murylomota\",\"from_user_id\":37112742,\"from_user_id_str\":\"37112742\"," +
			"\"geo\":null,\"id\":132671073371160576,\"id_str\":\"132671073371160576\",\"iso_language_code\":" +
			"\"pt\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":" +
			"\"http://a0.twimg.com/profile_images/1483287243/a_normal.jpg\",\"source\":" +
			"\"&lt;a href=&quot;http://www.panoramicsoft.com/mobileapps/motweets/moTweets.php&quot; rel=&quot;nofollow&quot;&gt;Panoramic moTweets&lt;/a&gt;" +
			"\",\"text\":\"pra mim, a dilma se masturba com o cabelo da mulher do obama\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":" +
			"\"Sat, 05 Nov 2011 04:10:19 +0000\",\"from_user\":\"jehdefilippis\",\"from_user_id\":214839259,\"from_user_id_str\":\"214839259\",\"geo\":null," +
			"\"id\":132671057739001856,\"id_str\":\"132671057739001856\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"}," +
			"\"profile_image_url\":\"http://a2.twimg.com/profile_images/1617846182/376792_10150381364614074_648004073_8220807_1714643225_n0_normal.jpg\"," +
			"\"source\":\"&lt;a href=&quot;http://blackberry.com/twitter&quot; rel=&quot;nofollow&quot;&gt;Twitter for BlackBerry\u00AE&lt;/a&gt;\",\"text" +
			"\":\"&quot;@aangelapolito: Needed that talk obama @viccmedeiros and that coke @jehdefilippis \u2665&quot; 'N' word? .. Farmacia?\",\"to_user_id" +
			"\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:18 +0000\",\"from_user\":\"nikki1573\",\"from_user_id\":378445120," +
			"\"from_user_id_str\":\"378445120\",\"geo\":null,\"id\":132671050738696192,\"id_str\":\"132671050738696192\",\"iso_language_code\":\"es\",\"metadata" +
			"\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a2.twimg.com/profile_images/1576662045/mQ3v4TUR_normal\",\"source\":" +
			"\"&lt;a href=&quot;http://twitter.com/download/android&quot; rel=&quot;nofollow&quot;&gt;Twitter for Android&lt;/a&gt;\",\"text" +
			"\":\"@uKnowValleo obama\",\"to_user\":\"uKnowValleo\",\"to_user_id\":286680162,\"to_user_id_str\":\"286680162\"},{\"created_at" +
			"\":\"Sat, 05 Nov 2011 04:10:17 +0000\",\"from_user\":\"infoeworld\",\"from_user_id\":433031192,\"from_user_id_str\":\"433031192" +
			"\",\"geo\":null,\"id\":132671047437795328,\"id_str\":\"132671047437795328\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type" +
			"\":\"recent\"},\"profile_image_url\":\"http://a3.twimg.com/sticky/default_profile_images/default_profile_4_normal.png\",\"source\":" +
			"\"&lt;a href=&quot;http://www.infoeworld.com/&quot; rel=&quot;nofollow&quot;&gt;infoeworld&lt;/a&gt;\",\"text\":" +
			"\"Obama Administration Opposes FDR Prayer at WWII Memorial http://t.co/6nsI3q3S\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at" +
			"\":\"Sat, 05 Nov 2011 04:10:11 +0000\",\"from_user\":\"CyG_US\",\"from_user_id\":123755483,\"from_user_id_str\":" +
			"\"123755483\",\"geo\":null,\"id\":132671023953879040,\"id_str\":\"132671023953879040\",\"iso_language_code\":\"en" +
			"\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a3.twimg.com/profile_images/1122210510/logo_USA_48_normal.png\"," +
			"\"source\":\"&lt;a href=&quot;http://cyg-newsagent.net/&quot; rel=&quot;nofollow&quot;&gt;CyG NewsAgent&lt;/a&gt;\"," +
			"\"text\":\"Poll: Obama, Romney even in 12 swing states http://t.co/uFNaAWV6\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:10 +0000\",\"from_user\":\"LauraLeticia27\",\"from_user_id\":160037829,\"from_user_id_str\":\"160037829\",\"geo\":null,\"id\":132671018811658241,\"id_str\":\"132671018811658241\",\"iso_language_code\":\"es\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a0.twimg.com/profile_images/1580931149/Edited_Photo-0147_normal.jpg\",\"source\":\"&lt;a href=&quot;http://mobile.twitter.com&quot; rel=&quot;nofollow&quot;&gt;Mobile Web&lt;/a&gt;\",\"text\":\"@PrisciPou sorry Obama me va a llevar :)\",\"to_user\":\"PrisciPou\",\"to_user_id\":138761720,\"to_user_id_str\":\"138761720\"},{\"created_at\":\"Sat, 05 Nov 2011 04:10:07 +0000\",\"from_user\":\"tdub850\",\"from_user_id\":200827832,\"from_user_id_str\":\"200827832\",\"geo\":null,\"id\":132671005335355392,\"id_str\":\"132671005335355392\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a1.twimg.com/profile_images/1275661404/FacebookHomescreenImage_normal.jpg\",\"source\":\"&lt;a href=&quot;http://twitter.com/#!/download/iphone&quot; rel=&quot;nofollow&quot;&gt;Twitter for iPhone&lt;/a&gt;\",\"text\":\"@cloudsurfnturf now you placing your bets on the market crashing!! What a patriot u R!! And #obama will be blamed for the global market now?\",\"to_user\":\"cloudsurfnturf\",\"to_user_id\":144976570,\"to_user_id_str\":\"144976570\"},{\"created_at\":\"Sat, 05 Nov 2011 04:10:06 +0000\",\"from_user\":\"ErikaPaoh\",\"from_user_id\":385834069,\"from_user_id_str\":\"385834069\",\"geo\":null,\"id\":132671002177048577,\"id_str\":\"132671002177048577\",\"iso_language_code\":\"es\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a3.twimg.com/profile_images/1623025998/YourPhoto_2011-10-5_16-23-17__normal.jpg\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\",\"text\":\"jaja @MaryClaryy fijat kn lo k salis xD jaja.. si weyy! imaginat! casemonos las 2 con obama! yo comparto a obama! jaja xD\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:04 +0000\",\"from_user\":\"TripSoGood\",\"from_user_id\":425372671,\"from_user_id_str\":\"425372671\",\"geo\":null,\"id\":132670994606333952,\"id_str\":\"132670994606333952\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a0.twimg.com/profile_images/1622365726/6Kmx19uc_normal\",\"source\":\"&lt;a href=&quot;http://twitter.com/download/android&quot; rel=&quot;nofollow&quot;&gt;Twitter for Android&lt;/a&gt;\",\"text\":\"Obama would be #guh but he'd understand. I'm just a nigga trying to prove my love.\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:03 +0000\",\"from_user\":\"mortgage_refins\",\"from_user_id\":406177054,\"from_user_id_str\":\"406177054\",\"geo\":null,\"id\":132670988637843456,\"id_str\":\"132670988637843456\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a3.twimg.com/profile_images/1539464433/florida-mortgage-refinance_normal.png\",\"source\":\"&lt;a href=&quot;http://twitterfeed.com&quot; rel=&quot;nofollow&quot;&gt;twitterfeed&lt;/a&gt;\",\"text\":\"Financially Battling Households Should certainly Maintain Properties In addition to Obama's Federal Mortgage Cha... http://t.co/iflaffh2\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:03 +0000\",\"from_user\":\"RogerBlazic\",\"from_user_id\":134202897,\"from_user_id_str\":\"134202897\",\"geo\":null,\"id\":132670988591697920,\"id_str\":\"132670988591697920\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a3.twimg.com/profile_images/1543512315/Screen_shot_2011-09-15_at_12.12.27_AM_normal.png\",\"source\":\"&lt;a href=&quot;http://www.hootsuite.com&quot; rel=&quot;nofollow&quot;&gt;HootSuite&lt;/a&gt;\",\"text\":\"Obama tries to strangle Stephen Hawking over God Doesn't Exist Remark http://t.co/uhUjW05j #humor #Comedy #lmao #lol #obama #atheism\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:10:02 +0000\",\"from_user\":\"Mortgage_refina\",\"from_user_id\":383471545,\"from_user_id_str\":\"383471545\",\"geo\":null,\"id\":132670986838478848,\"id_str\":\"132670986838478848\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a0.twimg.com/profile_images/1488369755/best-mortgage_normal.jpg\",\"source\":\"&lt;a href=&quot;http://twitterfeed.com&quot; rel=&quot;nofollow&quot;&gt;twitterfeed&lt;/a&gt;\",\"text\":\"Financially Battling Households Should certainly Maintain Properties In addition to Obama's Federal Mortgage Cha... http://t.co/Vge0GkGh\",\"to_user_id\":null,\"to_user_id_str\":null},{\"created_at\":\"Sat, 05 Nov 2011 04:09:59 +0000\",\"from_user\":\"mcsystemsgb\",\"from_user_id\":12289779,\"from_user_id_str\":\"12289779\",\"geo\":null,\"id\":132670974817607681,\"id_str\":\"132670974817607681\",\"iso_language_code\":\"en\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a1.twimg.com/profile_images/1289783535/gold_normal.jpg\",\"source\":\"&lt;a href=&quot;http://www.hootsuite.com&quot; rel=&quot;nofollow&quot;&gt;HootSuite&lt;/a&gt;\",\"text\":\"@deniseromano yeah Engval was pretty weak. Wouldn't dare endorse Obama. Would kill his business.\",\"to_user\":\"deniseromano\",\"to_user_id\":32220563,\"to_user_id_str\":\"32220563\"},{\"created_at\":\"Sat, 05 Nov 2011 04:09:59 +0000\",\"from_user\":\"Edhy_13milan\",\"from_user_id\":419220737,\"from_user_id_str\":\"419220737\",\"geo\":null,\"id\":132670974490451968,\"id_str\":\"132670974490451968\",\"iso_language_code\":\"in\",\"metadata\":{\"result_type\":\"recent\"},\"profile_image_url\":\"http://a1.twimg.com/profile_images/1543470161/IMG00034-20110721-2040_normal.jpg\",\"source\":\"&lt;a href=&quot;http://ubersocial.com&quot; rel=&quot;nofollow&quot;&gt;\u00DCberSocial for BlackBerry&lt;/a&gt;\",\"text\":\"RT @Milanistwit: Cassano, &quot;trima kash Obama karena telah menjenguk saya.&quot; canda Cassano ketika ia di jenguk sang Profesor, Clarence Seedorf.\",\"to_user_id\":null,\"to_user_id_str\":null}],\"results_per_page\":15,\"since_id\":0,\"since_id_str\":\"0\"}";

	public static void main(String[] args) {
		String result = "";
		String created_at ="Sat, 05 Nov 2011 04:10:23 +0000";
		// String[] array = {"Sun","Mon","Tue","Wen","Thr","Fri","Sat"};
		HashMap months = new HashMap();
		months.put("Jan", "01");
		months.put("Feb", "02");
		months.put("Mar", "03");
		months.put("Apr", "04");
		months.put("May", "05");
		months.put("Jun", "06");
		months.put("Jul", "07");
		months.put("Aug", "08");
		months.put("Sep", "09");
		months.put("Oct", "10");
		months.put("Nov", "11");
		months.put("Dec", "12");
		String time = "";
		String month = "";
		String date = "";
		
//		System.out.println(created_at.indexOf(":"));
		
		if (created_at.indexOf(":") > 0){
			time = created_at.substring(created_at.indexOf(":")-2,25) ;
			time = time.replaceAll(":","");
//			System.out.println(time);
		} else {
			System.err.print("there is no time!");
			new Exception("no time!");
		}
		result = created_at.substring(12,16);
//		System.out.println(result);		
		date = created_at.substring(5,7);
//		System.out.println(created_at.substring(8,11));
		month = (String) months.get(created_at.substring(8,11));
//		System.out.println(month);
		result = result + month + date + time;
//		System.out.println(result);
	}
}
